package com.bean;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

public class User {

    /**
     * 用户ID
     */
    @NotNull
    int userID;

    /**
     * 用户昵称
     */
    @NotNull
    @Size(min = 2,max = 10)
    String userName;

    /**
     * 密码
     */
    @NotNull
    @Size(min = 8,max = 16)
    String password;

    /**
     *
     */
    @NotNull
    boolean isLock;

    /**
     * 根据 id 的内容创建User对象
     * @param userID
     */
    public User(int userID) {
        this.userID = userID;
    }

    /**
     * 根据 id,adminName的内容创建User对象
     * @param userID
     * @param userName
     */
    public User(int userID, String userName) {
        this.userID = userID;
        this.userName = userName;
    }

    /**
     * 根据 id,adminName,password 的内容创建User对象
     * @param id
     * @param userName
     * @param password
     */
    public User(int id, String userName, String password) {
        this.userID = id;
        this.userName = userName;
        this.password = password;
    }

    /**
     * 根据 id,adminName,password,isLock 的内容创建User对象
     * @param userID
     * @param userName
     * @param password
     * @param isLock
     */
    public User(int userID, String userName, String password, boolean isLock) {
        this.userID = userID;
        this.userName = userName;
        this.password = password;
        this.isLock = isLock;
    }

    public User(String userName, String password) {

        this.userName = userName;
        this.password = password;
        this.isLock = false;
    }

    public int getUserID() {
        return userID;
    }

    public void setUserID(int userID) {
        this.userID = userID;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public boolean getLock() {
        return isLock;
    }

    public void setLock(boolean lock) {
        isLock = lock;
    }
}
